<?php
namespace app\admin\controller;
require '../vendor/autoload.php';

use think\Db;
use think\Controller;
class Index extends Controller
{
    //首页
    public function index()
    {
        $re = isLogins();
        if($re){
            return view('index');
        }else{
            $this->error('请先登陆！', 'Login/login');
        }

    }
    public function indexs()
    {
        //获取用户名
        $res = logins();
        $user_name = $res['username'];
        $this->assign('username',$user_name);
        return view('indexs');
    }
    public function left(){
        return view('left');
    }
    public function top(){
        //获取用户名
        $res = logins();
        $user_name = $res['username'];
        $this->assign('username',$user_name);
        return view('top');
    }
    //退出登陆
    public function logout(){
        logout();
        $this->error('退出成功！', 'Login/login');
    }

}
